'use strict';
const imageClassify = require('test-img-analysis');

function fn(image) {
	return new Promise((resolve, reject) => {
		imageClassify.advancedGeneral(image).then(function(result) {
			resolve(result);
		}).catch(function(err) {
			reject(err);
		});
	})
}
exports.main = async (event, context) => {
	//event为客户端上传的参数
	const result = await fn(event.image);
	//返回数据给客户端
	return result;
};
